import java.util.ArrayList;

public class CollectionPokemons {
	
	private ArrayList<Pokemon> poke = new ArrayList<Pokemon>();
	
	//Constructeur
	public CollectionPokemons(ArrayList<Pokemon> poke){
		this.poke=poke;
	}
	
	//Methodes
	public void inserer(Pokemon p){
		poke.add(p);
	}
	
	public double vitesseMoy(){
		double vittmp=0;
		for (int i=0; i<poke.size();i++){
			vittmp+=poke.get(i).vitesse();
		}
		
		return vittmp/poke.size();
	}

	public double vitesseMoyenneSportifs(){
		double vittmp=0;
		int ind=0;
		for (int i=0; i<poke.size();i++){
			if (poke.get(i) instanceof PokemonS){
				vittmp+=poke.get(i).vitesse();
				ind++;
			}
		}
		return vittmp/ind;
	}
}
